#include "Customer.h"

static int id = 0;

Customer::Customer() : m_id(0), m_arrivalTime(0), m_durationTime(0) {}

Customer::Customer(int id, int arrivalTime, int durationTime) : m_id(id), m_arrivalTime(arrivalTime),
                                                                m_durationTime(durationTime) {}

Customer::~Customer() {}

std::istream &operator>>(std::istream &is, Customer &customer) {
    customer.m_id = id++;
    is >> customer.m_arrivalTime >> customer.m_durationTime;
    return is;
}

std::ostream &operator<<(std::ostream &os, const Customer &customer) {
    os << "Customer " << customer.m_id << " arrives at " << customer.m_arrivalTime << " and waits for "
       << customer.m_durationTime << " minutes";
    return os;
}

int Customer::getId() const {
    return m_id;
}

int Customer::getArrivalTime() const {
    return m_arrivalTime;
}

int Customer::getDurationTime() const {
    return m_durationTime;
}
